import 'package:flutter/material.dart';
import 'package:animation/components/z_video/zsn_class.dart';

class ZsnBar extends StatelessWidget {
  final double currentVolume;
  final double height;
  final bool isVolume; // 默认音量图标
  const ZsnBar({
    super.key,
    required this.currentVolume,
    required this.height,
    this.isVolume = true,
  });
  @override
  Widget build(BuildContext context) {
    return Positioned(
      top: 45,
      width: 120,
      left: (MediaQuery.of(context).size.width - 120) / 2,
      child: Container(
        padding: EdgeInsets.all(5),
        decoration: BoxDecoration(
          color: const Color.fromARGB(87, 0, 0, 0),
          borderRadius: BorderRadius.circular(5),
        ),
        child: Row(
          children: [
            isVolume
                ? ZsnClass().volumeIcon(currentVolume)
                : ZsnClass().brightnessIcon(currentVolume),
            SizedBox(
              width: 3,
              height: 3,
            ),
            Expanded(
              child: LinearProgressIndicator(
                backgroundColor: Colors.grey[200],
                valueColor: AlwaysStoppedAnimation(Colors.deepOrange),
                value: currentVolume,
              ),
            )
          ],
        ),
      ),
    );
  }
}
